home *** CD-ROM | disk | FTP | other *** search
- #ifndef __AXE_H_
- #define __AXE_H_
-
- #include "drawtool.h"
-
- #include "geom.h"
- #include <string.h>
-
- // Incapsulate AXE attributes: length and so on.
- // If you want not use automatic ticks calculation, use start == end
- // and pass array of ticks coordinates.
-
-
-
- #define MAXLABELS 40
-
- struct Axe
- {
- int len_scr; // Length on screen, pixels
- int* ticks; // Ticks offset from axe beginning, pixels
- int* sub_ticks; // Sub-ticks, -//-
- char** labels; // Ticks commentaries
- int ticks_no; // Total number of ticks
- int sub_ticks_no; // Total number of sub ticks
-
- Axe(int len_on_screen, double start_of_axe = 0,
- double end_of_axe = 0, int total_tick_no = 5,
- int* tick_offsets = NULL, int total_sub_tick_no = 0,
- int* sub_ticks_offset = NULL, char** label_legends = NULL);
-
- ~Axe();
- virtual loc get_label_pos(loc, int ) { return loc(0, 0); }
- virtual void show_axe(loc, int) {}; // No labels
- void draw_axe(loc lt, int, int); // Show both axe and labels
- virtual void show_labels(loc) {};
- int calc_labels(double start, double end, int t = 5, int s = 0);
- };
-
-
- #endif __AXE_H_